program kernel;

uses applications, modules, debugger, hal, machine, exceptions, services,
	  machineimpl,
	  handles, vfs,
	  schedulers, schedulerRR, threads,
	  bochsgfx;

var h: THandle;
	 buf: array[0..4] of byte;
begin
	LogInfo('Initializing machine', ssKernel);
	MachineImpl.InitializeSpecifics;
	
	LogInfo('Initializing schedulers', ssKernel);
	Scheduler.RegisterSchedulers(TSchedulerRoundRobin);
	
	LogInfo('Kernel booted', ssKernel);
	
	//LogInfo('Installing bochs gfx adapter', ssKernel);
	//DevManager.AddDevice(TBochsGFX.Create.DeviceDescriptor);
	
	try
		TApplication.Create('boot:test');
	except
		on e: exception do
			writeln('Error: ', e.message);
	end;
	
	LogInfo('Done', ssKernel);
	
	Mach.EnableInterrupts;
end.
